package com.ruoyi.course.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.course.mapper.TExamMapper;
import com.ruoyi.course.domain.TExam;
import com.ruoyi.course.service.ITExamService;

/**
 * 考试Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-30
 */
@Service
public class TExamServiceImpl implements ITExamService 
{
    @Autowired
    private TExamMapper tExamMapper;

    /**
     * 查询考试
     * 
     * @param id 考试主键
     * @return 考试
     */
    @Override
    public TExam selectTExamById(Long id)
    {
        return tExamMapper.selectTExamById(id);
    }

    /**
     * 查询考试列表
     * 
     * @param tExam 考试
     * @return 考试
     */
    @Override
    public List<TExam> selectTExamList(TExam tExam)
    {
        return tExamMapper.selectTExamList(tExam);
    }

    /**
     * 新增考试
     * 
     * @param tExam 考试
     * @return 结果
     */
    @Override
    public int insertTExam(TExam tExam)
    {
        tExam.setCreateTime(DateUtils.getNowDate());
        return tExamMapper.insertTExam(tExam);
    }

    /**
     * 修改考试
     * 
     * @param tExam 考试
     * @return 结果
     */
    @Override
    public int updateTExam(TExam tExam)
    {
        tExam.setUpdateTime(DateUtils.getNowDate());
        return tExamMapper.updateTExam(tExam);
    }

    /**
     * 批量删除考试
     * 
     * @param ids 需要删除的考试主键
     * @return 结果
     */
    @Override
    public int deleteTExamByIds(Long[] ids)
    {
        return tExamMapper.deleteTExamByIds(ids);
    }

    /**
     * 删除考试信息
     * 
     * @param id 考试主键
     * @return 结果
     */
    @Override
    public int deleteTExamById(Long id)
    {
        return tExamMapper.deleteTExamById(id);
    }
}
